package cn.stylefeng.guns.sys.modular.system.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.sys.modular.system.entity.BtyTxl;
import cn.stylefeng.guns.sys.modular.system.entity.BtyTxlRY;
import cn.stylefeng.guns.sys.modular.system.mapper.BtyTxlMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BtyTxlService {

    @Autowired
    private BtyTxlMapper mapper;

    /**
     * 获取档案管理列表
     *
     * @author fengshuonan
     * @Date 2018/12/23 6:05 PM
     */

    public Page<Map<String, Object>> list(String ctbh, String dm, String csqy, String yyjlqy, String dd) {
        Page page = LayuiPageFactory.defaultPage();
        return this.mapper.list(page, ctbh, dm, csqy, yyjlqy, dd);
    }

    /**
     * 获取通讯录列表
     */
    public Object listExport(String ctbh, String dm, String csqy) {
        return this.mapper.listExport(ctbh, dm, csqy);
    }

    public BtyTxl getByID(Long id) {
        return this.mapper.getByID2(id);
    }


    public void delete(Long id) {
        this.mapper.delete(id);
    }

    public int updateTxl(BtyTxl btyTxl) {
        return this.mapper.updateTxl(btyTxl);
    }

    public int updateTxlRY(BtyTxl btyTxl) {
        return this.mapper.updateTxlRY(btyTxl);
    }

    public int addfzr(BtyTxlRY btyTxlRY) {
        return this.mapper.addfzr(btyTxlRY);
    }

    public int addct(BtyTxl btyTxl) {
        return this.mapper.addct(btyTxl);
    }

    public Page<Map<String, Object>> view(Long id) {
        Page page = LayuiPageFactory.defaultPage();
        return this.mapper.view(page, id);
    }

    public int view_delete(Long pid) {
        return this.mapper.view_delete(pid);
    }

    public BtyTxlRY view_update_getByID(Long pid) {
        return this.mapper.view_update_getByID(pid);
    }

    public int view_update(BtyTxlRY btyTxlRY) {
        return this.mapper.view_update(btyTxlRY);
    }

    public List<BtyTxl> selectTerm(String term) {
        return this.mapper.selectTerm(term);
    }
}
